const ordA = 'A'.charCodeAt(0); // 65

function ordinal(charCode){ // Ordinalstelle im Alphabet
    return charCode - ordA;
}

function shiftLetter(ordinal, shift){
    const code = ordA + (ordinal+shift) % 25;
    return String.fromCharCode(code)
}

export function clean(input){
    return input
        .toUpperCase()
        .replace(/Ö/g, "OE")
        .replace(/Ä/g, "AE")
        .replace(/Ü/g, "UE")
        .replace(/ß/g, "SZ")
        .replace(/\s+/g, '')
}

export function caesar(input, shift) {
    const cleaned = clean(input);
    return cleaned;
    let out = "";
    for (let i = 0; i < input.length; i++){
    const code = input.charCodeAt(i);
    out += shiftLetter(code, shift);
    }
    return clean(out);
}